export {}

// 字面量类型

let name: '老韩' = '老韩'

let age: 18 = 18


let str = 'hello ts'

str = 'dddddd'

const str1 = 'hello ts'

// 字面量类型的使用

// 性别
type Gender= '男' | '女'

let gender: Gender = '女'
gender = '男'


// 方向 (上下左右)

type Direction = 'up' | 'down' | 'left' | 'right'

function changeDirection (direction: Direction) {
  console.log(direction);
}
changeDirection('left')